﻿
using Family.Core.Model;
using FluentNHibernate.Mapping;

namespace Family.Data.Mappings
{
    public class OrderItemMap : ClassMap<OrderItem>
    {
        public OrderItemMap()
        {
            Id(i => i.Id).GeneratedBy.Native();
            Map(i => i.Amount).Not.Nullable();

            References(i => i.Order, "OrderId").Not.Nullable();

            References(i => i.Product, "ProductId").Not.Nullable();
        }
    }
}
